package com.sk.seckilldemo.controller;

import com.sk.seckilldemo.entity.UserInfo;
import com.sk.seckilldemo.service.UserService;
import com.sk.seckilldemo.util.Response;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 用户相关功能API
 * */
@RestController
@CrossOrigin
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {
    private final UserService userService;

    /**
     * 用户登录功能
     * */
    @PostMapping("/validateLogin")
    public Response validateLogin(@RequestBody UserInfo userInfo){
        System.out.println(userInfo);
        return userService.validateLogin(userInfo);
    }
}
